package core

import (
	"gitee.com/dreamwood/jxgo/v1/mgorm"
	"github.com/go-redis/redis"
	"github.com/nsqio/go-nsq"
	"go.mongodb.org/mongo-driver/mongo"
	"gorm.io/gorm"
)

const (
	EventBeforeConfigReady = "EventBeforeConfigReady"
	EventAfterConfigReady  = "EventAfterLoadConfig"
	//配置完成后才会触发serverRun事件
	EventBeforeServerRun = "EventBeforeServerRun"
	EventAfterServerRun  = "EventAfterServerRun"
	EventPublicKey       = "jx.public.event"
	EventPrivateKey      = "jx.private.event"

	LoggerNsqTopic = "jx.log.nsq"

	EzErrorLogDoc = `ErrLog`
	EzErrorReport = `ErrLog`

	EzPublicTopic     = "jx.public.topic"
	EzPublicChannel   = "jx.public.channel"
	EzTopicReg        = "jx.topic.reg"
	EzTopicRegApi     = "jx.topic.reg.api"
	EzTopicRegModel   = "jx.topic.reg.model"
	EzTopicHeartBeat  = "jx.topic.heart-beat"
	EzTopicOffline    = "jx.topic.offline"
	EzTopicRequestLog = "jx.topic.request-log"
	EzTopicErrorLog   = "jx.topic.error-log"
	EzTopicMessage    = "jx.topic.message"

	EzLogToFile    = "file"
	EzLogToConsole = "console"
	EzLogToNsq     = "nsq"
)

var NsqProducer *nsq.Producer
var NsqConsumer *nsq.Consumer

var DBMysql *gorm.DB
var DBMongo *mongo.Database
var DBRedis *redis.Client

var ConfigServer *ServerConfig
var ConfigApi *ApiConfig
var ConfigCore *CoreConfig
var ConfigService *ServiceConfig
var ConfigLog *LogConfig
var ConfigMongo *mgorm.MongoDbConfig

var LogConsole *ConsoleLogger
